import request from '@/plugins/request';
import { remove } from 'js-cookie';
///查询单条
export function GetData (id) {
    return request({
        url: `/api/digitalcanteen/device/${id}`,        
        method: 'get'
    });
}
///查询多条
export function GetList (param) {
    return request({
        url: `/api/digitalcanteen/device?pageIndex=${param.pageIndex}&pageSize=${param.pageSize}&sortType=${param.sortType}&sortKey=${param.sortKey}`,
        method: 'get'
    });
}
//新增、更新（data.id为空或没有id参数时为新增）
export function SaveData (data) {
    if(data.hasOwnProperty("id")){
        if(!data.id) delete data.id;
    }
    return request({
        url: `/api/digitalcanteen/device/`,    
        data:data,     
        method: 'post'
    });
}
//删除多条，id间用“,”分隔
export function Delete (idList) {
    return request({
        url: `/api/digitalcanteen/device?idList=${idList}`,        
        method: 'delete'
    });
}

//查询数据源数据
/*
export function deviceDataSource () {
    return request({
        url: `/api/digitalcanteen/device/devicedatasource`,        
        method: 'get'
    });
}
*/